from django.urls import path
from rest_framework.routers import SimpleRouter


from .views import QuestionView1
from question.views import LabelsView,QuestionView,HotQuestionView,WaitQuestionView
from question import views

urlpatterns = [
    path('questions/<int:pk>/', QuestionView1.as_view({
        'get': 'my_retrieve',
    })),

    path('labels/', LabelsView.as_view()),

    path('labels/users/', LabelsView.as_view()),
    # 最新回答问题
    path('questions/<str:pk>/label/new/', QuestionView.as_view()),
    # 最热回答的问题
    path('questions/<str:pk>/label/hot/', HotQuestionView.as_view()),
    # 等待回答的问题
    path('questions/<str:pk>/label/wait/', WaitQuestionView.as_view()),

    # 问题有用
    path('questions/<int:id>/useful/', views.QuestionRoleView.as_view()),
    # 问题无用
    path('questions/<int:id>/unuseful/', views.QuestionUnRoleView.as_view()),
    # 回答有用
    path('reply/<int:id>/useful/', views.ReplyRoleView.as_view()),
    # 回答无用
    path('reply/<int:id>/unuseful/', views.ReplyUnRoleView.as_view()),
    # 回答问题
    path('reply/', views.AnswerQuestion.as_view()),
]
